package com.wxl.common.serialport

class SerialD {

    companion object {

        /**
         * 注册获取控制器版本策略
         */
        fun registerControlVersionSerial(s:Serial){
            Serials.registerHexSingleKeySerial("23","BB",10,12,s)
        }

        /**
         * 取消获取控制器版本策略
         */
        fun unRegisterControlVersionSerial(){
            Serials.unRegisterHexSingleKeySerial("23","BB",10,12)
        }

        /**
         * 注册采集器插入策略
         */
        fun registerCjqSerial(v:Serial){
            Serials.registerHexSingleKeySerial("2313A0FF31AA","01",34,36,v)
        }

        /**
         * 取消采集器插入策略
         */
        fun unRegisterCjqSerial(){
            Serials.unRegisterHexSingleKeySerial("2313A0FF31AA","01", 34, 36)
        }

        /**
         * 注册充电时循环查询指令
         */
        fun registerChargeQuery(s:Serial){
            Serials.registerHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"08",20,22, s)
        }

        /**
         * 取消充电时循环查询指令
         */
        fun unRegisterChargeQuery(){
            Serials.unRegisterHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"08",20,22)
        }


        /**
         * 注册授权时循环查询指令
         */
        fun registerAuthProgressQuery(s:Serial){
            Serials.registerHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"06",20,22, s)
        }

        /**
         * 取消授权时循环查询指令
         */
        fun unRegisterAuthProgressQuery(){
            Serials.unRegisterHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"06",20,22)
        }


        /**
         * 注册写入延时时循环查询指令
         */
        fun registerDelayProgressQuery(s:Serial){
            Serials.registerHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"07",20,22, s)
        }

        /**
         * 取消写入延时时循环查询指令
         */
        fun unRegisterDelayProgressQuery(){
            Serials.unRegisterHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"07",20,22)
        }



        /**
         * 注册写入延时时循环查询指令
         */
        fun registerBlastProgressQuery(s:Serial){
            Serials.registerHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"09",20,22, s)
        }

        /**
         * 取消写入延时时循环查询指令
         */
        fun unRegisterBlastProgressQuery(){
            Serials.unRegisterHexSingleKeySerial(CmdCode.KZB_QUERY_LG_INFO_OK_ASK,"09",20,22)
        }
    }
}